# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=lomiri-api
pkgver=0.2.1
pkgrel=1
pkgdesc="API for Lomiri shell integration"
url="https://gitlab.com/ubports/development/core/lomiri-api"
arch="all"
license="LGPL-3.0-only"
depends_dev="
	gtest-dev
	qt5-qtdeclarative-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	gmock
	libqtdbustest
	samurai
	"
checkdepends="dbus"
source="https://gitlab.com/ubports/development/core/lomiri-api/-/archive/$pkgver/lomiri-api-$pkgver.tar.gz
	0001-Add-missing-headers-for-GCC13.patch
	qmltestrunner.patch
	"
subpackages="$pkgname-dev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9eb356d6733a780aabb8e8dde412c0aafca5dd021e1b093f5b369c778da0c0ae933e0a8f527528a85ae989d1856f8a3691117bacda1829716dadf253852ffb96  lomiri-api-0.2.1.tar.gz
08c2b3bd7d583064f60c29accd74d10cad64c221e79b84ec973dd0e31b0bfb180a30f3800c1695686d172198a0a15fdf4ae6860e84413bab2d19e89e693b32f7  0001-Add-missing-headers-for-GCC13.patch
04c316667ed5892c55278b01377d4d9c1a6ae14a330bfa594e5e54371d37441747684ab553799cb5e7804f4c68d181e78caeb8279491b9f5302a4e70095c74af  qmltestrunner.patch
"
